var simplifyPath = function (path) {
  let stack = [];
  let paths = path.split("/");

  for (const path of paths) {
    if (path == "" || path == ".") {
      continue;
    } else if (path == "..") {
      stack.pop();
    } else {
      stack.push(path);
    }
  }
  return "/" + stack.join("/");
};
